<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('strator_positions', function (Blueprint $table) {
            $table->id();

            $table->unsignedInteger('department_id')->index()->comment('部门id');
            $table->string('position_name')->comment('职务角色名称');
            $table->char('position_code',32)->unique()->nullable()->comment('职务角色代码');
            $table->string('position_remark')->nullable()->comment('职务简介，备注');
            $table->integer('sort')->default(0)->index()->comment('排序');

            $table->timestamps();
            $table->softDeletes();
        });

        \DB::statement("ALTER TABLE `strator_positions` comment '管理员部门里的职务角色表'");
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('strator_positions');
    }
};
